function submitCustForm(){
	document.addForm.submit();
} 


function change( val ){
	if( val == '1' ){
		document.getElementById('reson1').style.display = 'block';
		document.getElementById('reson2').style.display = 'block';
	}
	else{
		document.getElementById('reson1').style.display = 'none';
		document.getElementById('reson2').style.display = 'none';
	}
}

function searcher(){
		document.indexForm.submit();
	}
	

function judgeCheck()
{
    var pkid_string = '';
		var listsize = document.getElementById('listsize').value;
		for(var i=0;i<listsize;i++)
		{
				if(document.getElementById('checkone'+i).checked)
				{
					pkid_string += document.getElementById('checkone'+i).value+'|';
				}
		}
    return pkid_string;
}	


function changeTime(){

	var obj = document.getElementById('up_operating').value;
	if( obj == '' || obj.indexOf('-')>-1 || obj.indexOf('c')>-1 || obj.indexOf('d')>-1 ||obj=='ship_none' || obj=='ship_start'|| obj=='ship_end'){
		document.getElementById('b_g').style.display = 'none';
	}else{
		document.getElementById('b_g').style.display = 'inline';
	}
}

function operateInfo(val){

	var oper = document.getElementById(val+'_operating').value;
	if(oper == ''){
		alert('请选择操作方式!');
		return false;
	}

	var listsize = document.getElementById('listsize').value;

	var pkid_string = judgeCheck();
	if( pkid_string == '' ){
		alert('请至少选择一个会员进行操作!');
		return false;
	}
	if( oper == '-' ){
		document.getElementById('pkid').value = pkid_string;
		document.indexForm.action = '/doTradeReg.do';
		document.getElementById('bpm_id').value = '5732';
		if(window.confirm('确认删除吗?')){
			document.indexForm.submit();
		}
 	} else if( 'abcd'.indexOf(oper) > -1 ) {
		document.getElementById('pkid').value = pkid_string;
		document.indexForm.action='/doTradeReg.do';
		document.getElementById('bpm_id').value = '3568';
		if(window.confirm('确认提交吗?')){
			document.indexForm.submit();
		}
	}
	else if(oper=='ship_none' || oper=='ship_start'|| oper=='ship_end')
	{
	   
	   document.getElementById('pkid').value = pkid_string;
	   document.getElementById('state_code').value = oper;
	   document.getElementById('bpm_id').value = '3934';
	   document.indexForm.action='/doTradeReg.do';
	   if(window.confirm('确认提交吗?'))
	   {
			
		  document.indexForm.submit();
	   }
	}	
	else {
		document.getElementById('pkid').value = pkid_string;
		document.indexForm.action='/doTradeReg.do';
		document.getElementById('bpm_id').value = '2491';
		if(window.confirm('确认提交吗?')){
			document.indexForm.submit();
		}
	}

}

function deleteOneInfo(pkid,bpm_id)
{

	if(window.confirm('确认删除吗？'))
	{
	  window.location.href='/doTradeReg.do?pkid='+pkid+'&bpm_id='+bpm_id;
 	}
}